package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.SysCheck;
import com.ruoyi.system.mapper.SysCheckMapper;
import com.ruoyi.system.service.ISysCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class ISysCheckServiceImpl implements ISysCheckService {
    @Autowired
    private SysCheckMapper sysCheckMapper;

    @Override
    public List<SysCheck> selectCheckByIds(long[] ids) {
        List<SysCheck> list = new ArrayList<>();

        for (long checkId : ids) {
            SysCheck sysCheck = sysCheckMapper.selectCheckById(checkId);
            list.add(sysCheck);
        }
        return list;
    }

    @Override
    public List<SysCheck> selectAll() {
        return sysCheckMapper.selectAll();
    }

    @Override
    public List<SysCheck> selectCheckList(SysCheck check) {
        return sysCheckMapper.selectCheckList(check);
    }

    @Override
    public int insertCheck(SysCheck check) {
        return sysCheckMapper.insertCheck(check);
    }

    @Override
    public SysCheck selectCheckById(long checkId) {
        return sysCheckMapper.selectCheckById(checkId);
    }

    @Override
    public List<SysCheck> selectByKeyword(String keyword) {
        return sysCheckMapper.selectByKeyword(keyword);
    }

    @Override
    public int updateCheck(SysCheck check) {
        return sysCheckMapper.updateCheck(check);
    }

    @Override
    public int deleteByIds(long[] checkIds) {
        return sysCheckMapper.deleteCheckByIds(checkIds);
    }
}
